<template>
  <div class="noticeInfo">
    <Form :model="notice" :label-width="80">
      <FormItem label="标题">
        <Input type="text" v-model="notice.title"></Input>
      </FormItem>
      <FormItem label="类型">
        <RadioGroup v-model="notice.type" type="button">
            <Radio :label="1">热门</Radio>
            <Radio :label="2">推荐</Radio>
            <Radio :label="3">公告</Radio>
        </RadioGroup>
      </FormItem>
      <FormItem label="发布内容">
        <Input v-model="notice.content" maxlength="200" show-word-limit type="textarea" />
      </FormItem>
      <FormItem label="发布人">
        <Input type="text" v-model="notice.release"></Input>
      </FormItem>
      <FormItem label="发布时间">
        <DatePicker v-model="notice.releaseTime" format="yyyy年MM月dd日" type="date"></DatePicker>
      </FormItem>
      <FormItem label="发布状态">
        <RadioGroup v-model="notice.releaseState" type="button">
            <Radio :label="1">发布</Radio>
            <Radio :label="2">草稿</Radio>
            <Radio v-if="noticeInfo.activeType == 2" :label="3">过期</Radio>
        </RadioGroup>
      </FormItem>
    </Form>
  </div>
</template>

<script>
export default {
  props: {
    noticeInfo: {
      type: Object,
      default: () =>{}
    }
  },
  data () {
    return {
      notice: this.noticeInfo
    };
  },
  created() {
    if (Object.keys(this.noticeInfo).length == 0) {
      this.notice.updateTime = new Date();
    }
    console.log(this.noticeInfo,'this.noticeInfo');
  },
  watch: {
  },
  methods: {

  }
};
</script>

<style>
</style>
